<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\Product */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => '商品列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-view">

    <h1><?= Html::encode($this->title) ?></h1>



    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'name',
            'remark:ntext',
            'notes:ntext',
            'price',
            'newprice',
            ['attribute'=>'image','value'=>function($model){
                return Html::img($model->image);
            },'format'=>'raw'],
            ['attribute'=>'coupon_id','value'=>function($model){
               return \common\models\CouponCategory::findOne($model->coupon_id)->getAttribute("title");
            }],
            'description',
            'share_title',
            ['attribute'=>'share_img','value'=>function($model){
                return Html::img($model->share_img);
            },'format'=>'raw'],
            'share_txt',
            'share_url'

        ],
    ]) ?>

</div>
